import Vue from "vue";
import VueRouter, {RouteConfig} from "vue-router";
import Money from "@/views/Money.vue";
import Labels from "@/views/Labels.vue";
import Statistics from "@/views/Statistics.vue";
import NotFound from "@/views/NotFound.vue";
import EditLabel from "@/views/EditLabel.vue";

Vue.use(VueRouter);

const routes: RouteConfig[] = [
    {
        path: "/",
        redirect: '/money'
    },
    {
        path: "/money",
        component: Money

    },
    {
        path: "/labels",
        component: Labels
    },
    {
        path: "/statistics",
        component: Statistics
    },
    {
        path:'/labels/edit/:id',
        component: EditLabel
    },
    {
        path:'*',
        component: NotFound
    }
];

const router = new VueRouter({
    // 默认 hash 模式
    routes
});

// tslint:disable-next-line:no-default-export
export default router;
